package com.decent.ejfadmin.common.enums;

/**
 * 运营商
 *
 * @author hejunlei
 */
public enum Operator {
    /**
     * 移动
     */
    MOBILE(1, "移动", "MOBILE"),
    /**
     * 联通
     */
    UNICOM(2, "联通", "UNICOM"),
    /**
     * 电信
     */
    TELECOM(3, "电信", "TELECOM"),
    /**
     * 蜗牛
     */
    WONIU(20, "蜗牛", "WONIU"),
    /**
     * 迪信通
     */
    DIXINTONG(16, "迪信通", "DIXINTONG"),
    /**
     * 远特
     */
    YUANTE(15, "远特", "YUANTE"),
    /**
     * 中石化
     */
    SINOPEC(300, "中石化", "SINOPEC"),
    /**
     * 中石化无卡号
     */
    SINOPEC_NONNUM(302, "中石化无卡号", "SINOPECNONNUM"),
    /**
     * 中石油无卡号
     */
    CNPC_NONNUM(303, "中石油无卡号", "CNPCNONNUM"),
    /**
     * 中石油
     */
    CNPC(310, "中石油", "CNPC"),
    /**
     * 权益
     */
    EQUITY(1100, "权益", "EQUITY"),
    /**
     * 未知运营商
     */
    UNKNOWN(9999, "未知运营商", "");

    /**
     * 运营商编号
     */
    private Integer type;
    /**
     * 名称
     */
    private String operateName;
    /**
     * 销卡提交参数
     */
    private String supplyName;

    Operator(Integer type, String operateName, String supplyName) {
        this.type = type;
        this.operateName = operateName;
        this.supplyName = supplyName;
    }

    public Integer getType() {
        return type;
    }

    private void setType(Integer type) {
        this.type = type;
    }

    public String getOperateName() {
        return operateName;
    }

    private void setOperateName(String operateName) {
        this.operateName = operateName;
    }

    public String getSupplyName() {
        return supplyName;
    }

    private void setSupplyName(String supplyName) {
        this.supplyName = supplyName;
    }

    public static Operator matchOperator(Integer productType) {
        for (Operator operator : Operator.values()) {
            if (operator.getType().equals(productType)) {
                return operator;
            }
        }
        return UNKNOWN;
    }
}
